import { ElMessage } from 'element-plus'

// 成功消息
export const showSuccess = (message, duration = 3000) => {
  ElMessage({
    message,
    type: 'success',
    duration
  })
}

// 警告消息
export const showWarning = (message, duration = 3000) => {
  ElMessage({
    message,
    type: 'warning',
    duration
  })
}

// 错误消息
export const showError = (message, duration = 3000) => {
  ElMessage({
    message,
    type: 'error',
    duration
  })
}

// 信息消息
export const showInfo = (message, duration = 3000) => {
  ElMessage({
    message,
    type: 'info',
    duration
  })
}

// 主要消息
export const showPrimary = (message, duration = 3000) => {
  ElMessage({
    message,
    type: 'primary',
    duration
  })
}

// 默认导出所有方法
export default {
  success: showSuccess,
  warning: showWarning,
  error: showError,
  info: showInfo,
  primary: showPrimary
} 